﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Windows.Interactivity;
using NicoView.Speech;

namespace NicoView.View.Behaviors
{
    //
    // Action のターゲット要素をその親以外にしたい場合、クラスを
    // TriggerAction の代わりに TargetedTriggerAction から拡張します
    //
    public class MouseCursorChangeAction : TriggerAction<FrameworkElement>
    {
        public MouseCursorChangeAction()
        {

        }


        public static readonly DependencyProperty TargetCursorProperty =
                                          DependencyProperty.Register(
                                          "TargetCursor",
                                          typeof(Cursor),
                                          typeof(MouseCursorChangeAction),
                                          new FrameworkPropertyMetadata(Cursors.Arrow));

        public Cursor TargetCursor
        {
            get
            {
                return (Cursor)this.GetValue(TargetCursorProperty);
            }

            set
            {
                this.SetValue(TargetCursorProperty, value);
            }
        }

      

        protected override void Invoke(object msg)
        {

            this.AssociatedObject.Cursor = this.TargetCursor;
        }
    }
}